import java.util.List;

/**
 * 论文数据封装类，存储从docx中提取的所有指定字段
 */
public class PaperData {
    // 日期字段
    private String receivedDate;//收稿日期
    private String revisedDate;//修回日期
    private String acceptedDate;//录用日期
    private String publishedDate;//出版日期
    private String title;// 论文标题
    private String journalName;// 期刊名称
    private String pageInfo; // 格式：yyyy, Vol. XX(XX) 1–5；yyyy 年，第 XX 卷（第 XX 期），第 1-5 页
    private String doi; // DOI字段
    // 作者相关字段
    private List<Author> authors; // 作者列表
    private CorrespondingAuthor correspondingAuthor; // 通讯作者
    private String authorRawText; // 作者原始文本
    private String correspondingAuthorRawText; // 通讯作者原始文本
    // 内容字段
    private String abstractContent;//摘要
    private List<String> keywords; // 关键词列表
    private List<String> authorAffiliations; // 作者单位信息数组
    private String references; // 引用内容（含图片描述）

    // 无参构造
    public PaperData() {}

    // 全参构造（可选，用于快速初始化）
    public PaperData(String receivedDate, String revisedDate, String acceptedDate, String publishedDate,
                     String title, String journalName, String pageInfo, List<Author> authors,
                     CorrespondingAuthor correspondingAuthor, String abstractContent, List<String> keywords,
                     List<String> authorAffiliations, String references, String doi) {
        this.receivedDate = receivedDate;
        this.revisedDate = revisedDate;
        this.acceptedDate = acceptedDate;
        this.publishedDate = publishedDate;
        this.title = title;
        this.journalName = journalName;
        this.pageInfo = pageInfo;
        this.authors = authors;
        this.correspondingAuthor = correspondingAuthor;
        this.abstractContent = abstractContent;
        this.keywords = keywords;
        this.authorAffiliations = authorAffiliations;
        this.references = references;
        this.doi = doi;
    }

    // Getter和Setter方法（所有字段）
    public String getReceivedDate() { return receivedDate; }
    public void setReceivedDate(String receivedDate) { this.receivedDate = receivedDate; }
    public String getRevisedDate() { return revisedDate; }
    public void setRevisedDate(String revisedDate) { this.revisedDate = revisedDate; }
    public String getAcceptedDate() { return acceptedDate; }
    public void setAcceptedDate(String acceptedDate) { this.acceptedDate = acceptedDate; }
    public String getPublishedDate() { return publishedDate; }
    public void setPublishedDate(String publishedDate) { this.publishedDate = publishedDate; }
    public String getTitle() { return title; }
    public void setTitle(String title) { this.title = title; }
    public String getJournalName() { return journalName; }
    public void setJournalName(String journalName) { this.journalName = journalName; }
    public String getPageInfo() { return pageInfo; }
    public void setPageInfo(String pageInfo) { this.pageInfo = pageInfo; }
    public String getDoi() { return doi; }
    public void setDoi(String doi) { this.doi = doi; }
    public List<Author> getAuthors() { return authors; }
    public void setAuthors(List<Author> authors) { this.authors = authors; }
    public CorrespondingAuthor getCorrespondingAuthor() { return correspondingAuthor; }
    public void setCorrespondingAuthor(CorrespondingAuthor correspondingAuthor) { this.correspondingAuthor = correspondingAuthor; }
    public String getAuthorRawText() { return authorRawText; }
    public void setAuthorRawText(String authorRawText) { this.authorRawText = authorRawText; }
    public String getCorrespondingAuthorRawText() { return correspondingAuthorRawText; }
    public void setCorrespondingAuthorRawText(String correspondingAuthorRawText) { this.correspondingAuthorRawText = correspondingAuthorRawText; }
    public String getAbstractContent() { return abstractContent; }
    public void setAbstractContent(String abstractContent) { this.abstractContent = abstractContent; }
    public List<String> getKeywords() { return keywords; }
    public void setKeywords(List<String> keywords) { this.keywords = keywords; }
    public List<String> getAuthorAffiliations() { return authorAffiliations; }
    public void setAuthorAffiliations(List<String> authorAffiliations) { this.authorAffiliations = authorAffiliations; }
    public String getReferences() { return references; }
    public void setReferences(String references) { this.references = references; }

    // 重写toString()，用于打印提取结果
    @Override
    public String toString() {
        return "PaperData{" +
                "\nreceivedDate='" + receivedDate + '\'' +
                ", \nrevisedDate='" + revisedDate + '\'' +
                ", \nacceptedDate='" + acceptedDate + '\'' +
                ", \npublishedDate='" + publishedDate + '\'' +
                ", \ntitle='" + title + '\'' +
                ", \njournalName='" + journalName + '\'' +
                ", \ndoi='" + doi + '\'' +
                ", \npageInfo='" + pageInfo + '\'' +
                ", \nauthors=" + authors +
                ", \ncorrespondingAuthor=" + correspondingAuthor +
                ", \nauthorRawText='" + authorRawText + '\'' +
                ", \ncorrespondingAuthorRawText='" + correspondingAuthorRawText + '\'' +
                ", \nauthorAffiliations=" + authorAffiliations +
                ", \nabstractContent='" + abstractContent + '\'' +
                ", \nkeywords=" + keywords +
                ", \nreferences='" + references + '\'' +
                "\n}";
    }
}